﻿using System.Collections.Generic;
using Iesi.Collections.Generic;

namespace ScrumBox.Model
{
    public class SprintBackLogItem
    {
        private string _title;
        private Sprint _sprint;
        private ISet<Task> _tasks = new HashedSet<Task>();
        private ProductBackLogItem _associatedProductBackLogItem;

        /// <summary>
        /// 
        /// </summary>
        public SprintBackLogItem()
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="springBackLog"></param>
        public SprintBackLogItem(Sprint springBackLog)
        {
            _sprint = springBackLog;
        }

        /// <summary>
        /// The Associated ProductBackLog Item
        /// </summary>
        public virtual ProductBackLogItem AssociatedProductBackLogItem
        {
            get { return _associatedProductBackLogItem;  }
            set { _associatedProductBackLogItem = value; }
        }

        /// <summary>
        /// Sprint
        /// </summary>
        public virtual Sprint Sprint
        {
            get { return _sprint; }
            set { _sprint = value; }
        }

        /// <summary>
        /// Title
        /// </summary>
        public virtual string Title
        {
            get { return _title; }
            set { _title = value; }
        }

        /// <summary>
        /// 
        /// </summary>
        public IList<Task> GetTasks()
        {
            return new List<Task>(_tasks);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="task"></param>
        public void AddTask(Task task)
        {
            _tasks.Add(task);
        }
    }
}